package com.niit.service.impl;

import com.niit.dao.*;
import com.niit.pojo.StudentTable;
import com.niit.service.HbaseService;

import java.io.IOException;
import java.util.List;

/**
 * @author 杨铭
 * 2022/2/7,17:49
 */
public class HbaseServiceImpl implements HbaseService {
    /**
     * 和Hbase连接创建
     *
     * @return*/


    @Override
    public int add(StudentTable studentTable) throws IOException {
        addStudent addStudent=new addStudent();
        int x = addStudent.add(studentTable);
        return x;
    }

    @Override
    public void delete(String tableName,StudentTable studentTable) throws IOException {
         deleteStudent deletestudent = new deleteStudent();
         deletestudent.delete(tableName,studentTable);
    }

    @Override
    public void update(StudentTable studentTable) throws IOException {
         updateStudent updateStudent = new updateStudent();
         updateStudent.update(studentTable);

    }

    @Override
    public List<StudentTable> scanByPage(String endRow) throws IOException {
        displayStudent displayStudent=new displayStudent();
        return displayStudent.scanByPage(endRow);
    }
    @Override
    public List<StudentTable> displayByindividual(StudentTable studentTable) throws IOException{
        System.out.println(studentTable.getStudentStatus());
        DisplayIndividual displayIndividual=new DisplayIndividual();
        return  displayIndividual.display(studentTable);
    }






}
